
package saxon.gui.view.swing;

import java.awt.Component;
import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.JPanel;

/**
 *
 * @author lennyn
 */
public class HPanel extends JPanel {


	
	public HPanel(Component... components) {
		this.setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
		for (Component comp: components)
			this.add(comp);
	}

	public HPanel() {
		this.setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
	}

	public void setSpaceBetweenComponents(int size) {
		
	}

	public static Component glue() {
		return Box.createHorizontalGlue();
	}

	public static Component separator(int width) {
		return Box.createHorizontalStrut(width);
	}

	@Override
	public void setEnabled(boolean enabled) {
		for (Component comp: this.getComponents())
			comp.setEnabled(enabled);
	}
}
